package com.syedu.day15.homework;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;

/**
 * description：
 * @author Administrator
 * @date 2022/4/1 9:14
 */
public class Exercise2 {
    public static void main(String[] args) {
        try {
            List<String> lines = Files.readAllLines(Path.of("src/知识点复习.txt"));
            for (String line : lines) {
                char[] chars = line.toCharArray();
                for (char c : chars) {
                    System.out.print(c);
                    try {
                        Thread.sleep((long) (Math.random() * 200));
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                System.out.println();
            }
        } catch (IOException e) {
            System.err.println("数据文件加载失败...");
        }
    }
}